package me.tonywang.springxml;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Main {

     public static void main(String[] args) {
        //HelloWorld hellworld = new HelloWorld();
        //hellworld.setName("xiaomei");
        ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
        HelloWorld helloworld = ctx.getBean(HelloWorld.class);
        helloworld.hello();
        Car car=(Car) ctx.getBean("car");
        Car car2=(Car) ctx.getBean("car2");
        Person person =   ctx.getBean("person",Person.class);
        System.out.println(car.toString());
        System.out.println(car2.toString());
        System.out.println(person.toString());
    }

}
